/**
 * AuthorTag 组件样式 - 精简版（仅默认样式）
 */

.author-tag {
  margin: 1.5rem 0;
  font-family: var(--vp-font-family-base);

  .author-tag-default {
    background: linear-gradient(
      135deg,
      rgba(var(--vp-c-brand-1-rgb, 100, 108, 255), 0.03) 0%,
      var(--vp-c-bg-soft) 100%
    );
    border: 1px solid var(--vp-c-divider);
    border-left: 3px solid var(--vp-c-brand-1);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(
        90deg,
        var(--vp-c-brand-1) 0%,
        var(--vp-c-brand-2) 50%,
        transparent 100%
      );
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    &:hover {
      border-left-width: 4px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
      transform: translateY(-2px);

      &::before {
        opacity: 1;
      }
    }
  }

  .author-header {
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid rgba(var(--vp-c-divider-rgb, 224, 224, 230), 0.5);

    .author-label {
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--vp-c-brand-1);
      display: inline-flex;
      align-items: center;
      gap: 0.375rem;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }
  }

  .author-content {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

    // 头像容器（支持双层显示）
    .author-avatar-container {
      position: relative;
      width: 56px;
      height: 56px;
      flex-shrink: 0;
    }
  .author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--vp-c-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--vp-c-brand-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    &:hover {
      transform: scale(1.08) rotate(3deg);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15),
        0 0 0 2px var(--vp-c-brand-1);
    }
  }

    // 默认头像样式（字母头像，作为背景层）
    .author-avatar-default {
      position: absolute;
      top: 0;
      left: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      font-weight: 700;
      color: #fff;
      background: linear-gradient(135deg, var(--vp-c-brand-1) 0%, var(--vp-c-brand-2) 100%);
      cursor: default;
      user-select: none;
      letter-spacing: 0;
      opacity: 1;
      transition: opacity 0.4s ease-in-out;
  
      &.avatar-hidden {
        opacity: 0;
        pointer-events: none;
      }
  
      &:hover {
        transform: scale(1.08);
      }
    }
  
    // 真实图片头像（作为上层）
    .author-avatar-image {
      position: absolute;
      top: 0;
      left: 0;
      object-fit: cover;
      opacity: 0;
      transition: opacity 0.4s ease-in-out;
  
      &.avatar-loaded {
        opacity: 1;
      }
  
      &:hover {
        transform: scale(1.08) rotate(3deg);
      }
    }
  .author-details {
    flex: 1;
    min-width: 0;
  }

  .author-main-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
  }

  .author-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--vp-c-text-1);
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.4;

    &:hover {
      color: var(--vp-c-brand-1);
    }
  }

  .author-role {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(
      135deg,
      var(--vp-c-brand-soft) 0%,
      var(--vp-c-brand-lighter) 100%
    );
    color: var(--vp-c-brand-dark);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(var(--vp-c-brand-1-rgb, 100, 108, 255), 0.1);
  }

  .author-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.125rem;
  }

  .employee-id,
  .department {
    font-size: 0.8125rem;
    color: var(--vp-c-text-2);
    background: var(--vp-c-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--vp-c-divider-light);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--vp-font-family-base);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);

    &:hover {
      border-color: var(--vp-c-brand-soft);
      background: var(--vp-c-bg-soft);
    }
  }

  .employee-id {
    font-family: "Monaco", "Courier New", monospace;
    font-weight: 500;

    &::before {
      content: "👤";
      font-size: 0.875rem;
    }
  }

  .department {
    &::before {
      content: "🏢";
      font-size: 0.875rem;
    }
  }

  // 响应式设计
  @media (max-width: 768px) {
    .author-tag-default {
      padding: 1rem;
    }

    .author-content {
      gap: 0.875rem;
    }

        .author-avatar-container {
          width: 48px;
          height: 48px;
        }
    .author-avatar {
      width: 48px;
      height: 48px;
    }

        .author-avatar-default {
          font-size: 1.25rem;
        }
    .author-main-info {
      flex-wrap: wrap;
    }
    }
  
    @media (max-width: 480px) {
    margin: 1rem 0;

    .author-tag-default {
      padding: 0.875rem;
    }

    .author-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
    }
  }
}
